package com.example.current.atomic;

import java.util.concurrent.locks.ReentrantLock;

public class AtomicUse {
    static ReentrantLock  reentrantLock = new ReentrantLock();
    public static void main(String[] args) throws Exception {

        reentrantLock.lock();
        new Thread(new Runnable() {
            @Override
            public void run() {
                reentrantLock.lock();
                System.out.println("bbb");
                reentrantLock.unlock();
            }
        }).start();
        Thread.sleep(5000);
        System.out.println("aaa");
        reentrantLock.unlock();
    }
}
